/////////////////////////////////////////////////////////////////////////
//
// Amuse Engine - graphics/scene/collection
// Copyright (c) 2015.  All Rights Reserved
//
// File:		AEMeshBufferCollection.h
// Author:		Gianluca Belardelli
// Date:		12/06/2015
//
/////////////////////////////////////////////////////////////////////////
#ifndef _AEMESHBUFFERCOLLECTION_H_
#define _AEMESHBUFFERCOLLECTION_H_

class AEMeshBufferCollection : public AERenderCollection
{
public:
	/// \brief
	///   Constructor of the VisMeshBufferObjectCollection_cl class
	/// 
	/// This is a constructor of the mesh buffer object collection class taking an array of
	/// VisMeshBufferObject_cl pointers as input.
	/// 
	/// The array of pointers will be copied into the collection.
	/// 
	/// \param iNumEntries
	///   Number of elements to copy
	/// 
	/// \param pEntryList
	///   Pointer to the array of pointers to copy
	/// 
	/// \param iSize
	///   Size of the collection (where iSize>=iNumEntries)
	/// 
	/// \param iMemGranularity
	///   Whenever additional elements are added to a collection, and the number of elements becomes
	///   too big for the currently allocated size of the collection, the collection is re-allocated.
	///   This parameter defines the increments of each re-allocation step.
	AE_DLLIMPEXP AEMeshBufferCollection( AEUINT32 uiNumEntries, AEMeshBuffer * const *lpEntryList, AEUINT32 uiSize, AEUINT32 uiMemGranularity=1024 );

	/// \brief Costruttore della classe AEMeshBufferCollection.
	/// \param uiSize Dimensione iniziale della Collection espressa in numero
	/// di elementi.
	/// \param uiMemGranularity
	///   Whenever additional elements are added to a collection, and the number of elements becomes
	///   too big for the currently allocated size of the collection, the collection is re-allocated.
	///   This parameter defines the increments of each re-allocation step.
	AE_DLLIMPEXP AEMeshBufferCollection( AEUINT32 uiSize, AEUINT32 uiMemGranularity=1024 );

	/// \brief
	///   Casts the entry with given index to mesh buffer object pointer.
	AE_FORCEINLINE AEMeshBuffer *GetEntry( AEUINT32 uiIndex) const;

	/// \brief
	///   Appends a mesh buffer instance to this collection
	AE_FORCEINLINE void AppendEntry( AEMeshBuffer *lpObject );

	/// \brief
	///   Appends a mesh buffer instance to this collection without range checking
	AE_FORCEINLINE void AppendEntryFast( AEMeshBuffer *lpObject );

	/// \brief
	///   Returns the pointer to the mesh buffer instance collection list.
	AE_FORCEINLINE AEMeshBuffer **GetDataPtr( void ) const;
};

#include "AEMeshBufferCollection.inl"

#endif // _AEMESHBUFFERCOLLECTION_H_
